// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   Condition.java

package dale.web.domain;

import dale.web.Domain;
import org.apache.commons.lang.StringUtils;

public class Condition extends Domain
{

    public Condition()
    {
        page = 1;
        rowcnt = 10;
        key = "";
    }

    public int getPage()
    {
        return page;
    }

    public void setPage(int page)
    {
        this.page = page;
    }

    public int getRowcnt()
    {
        return rowcnt;
    }

    public void setRowcnt(int rowcnt)
    {
        this.rowcnt = rowcnt;
    }

    public String getKey()
    {
        return key;
    }

    public void setKey(String key)
    {
        this.key = key;
    }

    public int getOffset()
    {
        return (page - 1) * 10;
    }

    public String getWildKey()
    {
        String wildKey = "%";
        String as[];
        int j = (as = StringUtils.split(key)).length;
        for(int i = 0; i < j; i++)
        {
            String token = as[i];
            wildKey = (new StringBuilder(String.valueOf(wildKey))).append(token).append("%").toString();
        }

        return wildKey;
    }

    private static final long serialVersionUID = 1L;
    private int page;
    private int rowcnt;
    private String key;
}
